package org.eenie.kdassistant.injector.modules;


import org.eenie.kdassistant.App;
import org.eenie.kdassistant.net.AssistantApi;
import org.eenie.kdassistant.net.ParamsAnalog;
import org.eenie.kdassistant.net.kdy_api.KdyApi;
import org.eenie.kdassistant.net.xz_api.XingZheApi;
import org.eenie.kdassistant.net.yd_api.YDApi;
import org.eenie.kdassistant.net.zzt_api.ZZTApi;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import okhttp3.OkHttpClient;

/**
 * Created by Eenie on 2017/5/4.
 * Email: eeniework@gmail.com
 * Des:提供API相关的实例
 */

@Module
public class ApiModule {

    @Provides
    @Singleton
    KdyApi provideKdyApi(App app, OkHttpClient client, ParamsAnalog paramsAnalog, AssistantApi assistantApi) {

        return new KdyApi(app, client, paramsAnalog,assistantApi);
    }



    @Provides
    @Singleton
    XingZheApi provideXingZheApi(OkHttpClient client, ParamsAnalog paramsAnalog, AssistantApi assistantApi) {

        return new XingZheApi(client, paramsAnalog,assistantApi);
    }
    @Provides
    @Singleton
    ZZTApi provideZZTApi(ParamsAnalog paramsAnalog, AssistantApi assistantApi) {
        return new ZZTApi(paramsAnalog,assistantApi);
    }
    @Provides
    @Singleton
    AssistantApi provideAssistantApi(OkHttpClient client) {
        return new AssistantApi(client);
    }

    @Provides
    @Singleton
    YDApi provideYDApi(OkHttpClient client,ParamsAnalog paramsAnalog, AssistantApi assistantApi) {
        return new YDApi(client,paramsAnalog,assistantApi);
    }

}
